// 封装字符串高亮的方法
export const lightFn = (str, target) => {
  // i 忽略大小写  g全局匹配 target 匹配规则
  const reg = new RegExp(target, 'ig')
  return str.replace(reg, (match) => {
    return `<span style="color:red">${match}</span>`
  })
}
